<extend name="./Common/View/Public/list.html" />

<block name="page_title">班级列表</block>
<block name="search">
    <div class="layui-input-inline">
        <select name="grade" id="grade" lay-filter="grade" api="sys/Config/grade" empty="年级"></select>
    </div>
    <div class="layui-input-inline">
        <select name="depart_id" id="depart_id" lay-filter="depart_id" api="base/Department/slist/status/1/type/3" empty="所在专业"></select>
    </div>
    <div class="layui-input-inline">
        <select name="status" id="status" lay-filter="status" api="sys/Dict/info/code/STATUS" empty="状态"></select>
    </div>
    <div class="layui-input-inline">
        <input class="layui-input" name="keywords" autocomplete="off" placeholder="班级名称" />
    </div>
</block>
<block name="toolbar">
    {:W('Todo/UI/toolbar',array('班级',array('add','delete','enable','disable','imports','exports')))}
</block>
<block name="main">
    <script type="text/javascript">
        var list = {api:"{$Think.const.MODULE_NAME}/{$Think.const.CONTROLLER_NAME}/"};
        list.columns =  [[
            {checkbox: true, fixed: true}
            , {field:'title', minWidth:100, title : '班级名称'}
            , {field:'pid', minWidth:100, title : '专业', templet: '#tpl_department'}
            , {field:'grade', minWidth:100, title : '年级'}
            , {field: 'system', title: '学制 ', width: 100}
            , {field: 'status', title: '状态', width: 80, sort: true, templet: '#tpl_status'}
            ,{fixed: 'right', minWidth:100, align:'center', toolbar: '#tpl_bar'}
        ]];
    </script>
    <script type="text/html" id="tpl_bar">
        {{ format_optbar(['edit','delete']) }}
    </script>
    <script type="text/html" id="tpl_department">
        {{ format_data_department(d.depart_id) }}
    </script>
    <script type="text/html" id="tpl_status">
        {{ format_status(d.status) }}
    </script>
</block>
<block name="script">
    <script src="/api/Base/Department/format"></script>
</block>